{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 忽略各模块的警告信息\n",
    "import warnings\n",
    "warnings.filterwarnings(\"ignore\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 加载所需使用的模块\n",
    "from datetime import datetime\n",
    "\n",
    "from vnpy.trader.datafeed import get_datafeed\n",
    "from vnpy.trader.database import get_database, DB_TZ\n",
    "from vnpy.trader.constant import Interval\n",
    "from vnpy.trader.object import BarData, HistoryRequest\n",
    "from vnpy.trader.utility import extract_vt_symbol\n",
    "from vnpy.trader.setting import SETTINGS\n",
    "\n",
    "import pymysql"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 配置数据服务\n",
    "SETTINGS[\"datafeed.name\"] = \"tushare\"            # 可以根据自己的需求选择数据服务：rqdata/xt/wind等\n",
    "SETTINGS[\"datafeed.username\"] = \"835983\"       # RQData的用户名统一为“license”这个字符串\n",
    "SETTINGS[\"datafeed.password\"] = \"f9070562c743804c9627e56832d30c32a22f2f8c06633357428e6d98\"        # 这里需要替换为你购买或者申请试用的RQData数据license\n",
    "\n",
    "# 配置数据库\n",
    "SETTINGS[\"database.name\"] = \"mysql\"              # 可以根据自己的需求选择数据库，这里使用的是TDengine\n",
    "SETTINGS[\"database.database\"] = \"vnpy\"\n",
    "SETTINGS[\"database.host\"] = \"127.0.0.1\"\n",
    "SETTINGS[\"database.port\"] = 3306\n",
    "SETTINGS[\"database.user\"] = \"root\"\n",
    "SETTINGS[\"database.password\"] = \"12345678\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 创建对象实例\n",
    "datafeed = get_datafeed()\n",
    "\n",
    "database = get_database()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['430017.BSE', '430047.BSE', '430090.BSE', '430139.BSE', '430198.BSE', '430300.BSE', '430418.BSE', '430425.BSE', '430476.BSE', '430478.BSE', '430510.BSE', '430556.BSE', '430564.BSE', '430685.BSE', '430718.BSE', '600000.SSE', '600004.SSE', '600006.SSE', '600007.SSE', '600008.SSE', '600009.SSE', '600010.SSE', '600011.SSE', '600012.SSE', '600015.SSE', '600016.SSE', '600017.SSE', '600018.SSE', '600019.SSE', '600020.SSE', '600021.SSE', '600022.SSE', '600023.SSE', '600025.SSE', '600026.SSE', '600027.SSE', '600028.SSE', '600029.SSE', '600030.SSE', '600031.SSE', '600032.SSE', '600033.SSE', '600035.SSE', '600036.SSE', '600037.SSE', '600038.SSE', '600039.SSE', '600048.SSE', '600050.SSE', '600051.SSE', '600052.SSE', '600053.SSE', '600054.SSE', '600055.SSE', '600056.SSE', '600057.SSE', '600058.SSE', '600059.SSE', '600060.SSE', '600061.SSE', '600062.SSE', '600063.SSE', '600064.SSE', '600066.SSE', '600067.SSE', '600071.SSE', '600072.SSE', '600073.SSE', '600075.SSE', '600076.SSE', '600078.SSE', '600079.SSE', '600080.SSE', '600081.SSE', '600082.SSE', '600084.SSE', '600085.SSE', '600088.SSE', '600089.SSE', '600094.SSE', '600095.SSE', '600096.SSE', '600097.SSE', '600098.SSE', '600099.SSE', '600100.SSE', '600101.SSE', '600103.SSE', '600104.SSE', '600105.SSE', '600106.SSE', '600107.SSE', '600108.SSE', '600109.SSE', '600110.SSE', '600111.SSE', '600113.SSE', '600114.SSE', '600115.SSE', '600116.SSE', '600117.SSE', '600118.SSE', '600119.SSE', '600120.SSE', '600121.SSE', '600123.SSE', '600125.SSE', '600126.SSE', '600127.SSE', '600128.SSE', '600129.SSE', '600130.SSE', '600131.SSE', '600132.SSE', '600133.SSE', '600135.SSE', '600136.SSE', '600137.SSE', '600138.SSE', '600141.SSE', '600143.SSE', '600148.SSE', '600149.SSE', '600150.SSE', '600151.SSE', '600152.SSE', '600153.SSE', '600155.SSE', '600156.SSE', '600157.SSE', '600158.SSE', '600159.SSE', '600160.SSE', '600161.SSE', '600162.SSE', '600163.SSE', '600165.SSE', '600166.SSE', '600167.SSE', '600168.SSE', '600169.SSE', '600170.SSE', '600171.SSE', '600172.SSE', '600173.SSE', '600176.SSE', '600177.SSE', '600178.SSE', '600179.SSE', '600180.SSE', '600182.SSE', '600183.SSE', '600184.SSE', '600185.SSE', '600186.SSE', '600187.SSE', '600188.SSE', '600189.SSE', '600191.SSE', '600192.SSE', '600193.SSE', '600195.SSE', '600196.SSE', '600197.SSE', '600198.SSE', '600199.SSE', '600200.SSE', '600201.SSE', '600202.SSE', '600203.SSE', '600206.SSE', '600207.SSE', '600208.SSE', '600210.SSE', '600211.SSE', '600212.SSE', '600215.SSE', '600216.SSE', '600217.SSE', '600218.SSE', '600219.SSE', '600221.SSE', '600222.SSE', '600223.SSE', '600226.SSE', '600227.SSE', '600228.SSE', '600229.SSE', '600230.SSE', '600231.SSE', '600232.SSE', '600233.SSE', '600234.SSE', '600235.SSE', '600236.SSE', '600237.SSE', '600238.SSE', '600239.SSE', '600241.SSE', '600243.SSE', '600246.SSE', '600248.SSE', '600249.SSE', '600250.SSE', '600251.SSE', '600252.SSE', '600255.SSE', '600256.SSE', '600257.SSE', '600258.SSE', '600259.SSE', '600261.SSE', '600262.SSE', '600265.SSE', '600266.SSE', '600267.SSE', '600268.SSE', '600269.SSE', '600271.SSE', '600272.SSE', '600273.SSE', '600276.SSE', '600278.SSE', '600279.SSE', '600280.SSE', '600281.SSE', '600282.SSE', '600283.SSE', '600284.SSE', '600285.SSE', '600287.SSE', '600288.SSE', '600289.SSE', '600292.SSE', '600293.SSE', '600295.SSE', '600298.SSE', '600299.SSE', '600300.SSE', '600301.SSE', '600302.SSE', '600303.SSE', '600305.SSE', '600307.SSE', '600308.SSE', '600309.SSE', '600310.SSE', '600312.SSE', '600313.SSE', '600315.SSE', '600316.SSE', '600318.SSE', '600319.SSE', '600320.SSE', '600322.SSE', '600323.SSE', '600325.SSE', '600326.SSE', '600327.SSE', '600328.SSE', '600329.SSE', '600330.SSE', '600331.SSE', '600332.SSE', '600333.SSE', '600335.SSE', '600336.SSE', '600337.SSE', '600338.SSE', '600339.SSE', '600340.SSE', '600343.SSE', '600345.SSE', '600346.SSE', '600348.SSE', '600350.SSE', '600351.SSE', '600352.SSE', '600353.SSE', '600354.SSE', '600355.SSE', '600356.SSE', '600358.SSE', '600359.SSE', '600360.SSE', '600361.SSE', '600362.SSE', '600363.SSE', '600365.SSE', '600366.SSE', '600367.SSE', '600368.SSE', '600369.SSE', '600370.SSE', '600371.SSE', '600372.SSE', '600373.SSE', '600375.SSE', '600376.SSE', '600377.SSE', '600378.SSE', '600379.SSE', '600380.SSE', '600381.SSE', '600382.SSE', '600383.SSE', '600386.SSE', '600388.SSE', '600389.SSE', '600390.SSE', '600391.SSE', '600392.SSE', '600395.SSE', '600396.SSE', '600397.SSE', '600398.SSE', '600399.SSE', '600400.SSE', '600403.SSE', '600405.SSE', '600406.SSE', '600408.SSE', '600409.SSE', '600410.SSE', '600415.SSE', '600416.SSE', '600418.SSE', '600419.SSE', '600420.SSE', '600421.SSE', '600422.SSE', '600423.SSE', '600425.SSE', '600426.SSE', '600428.SSE', '600429.SSE', '600433.SSE', '600435.SSE', '600436.SSE', '600438.SSE', '600439.SSE', '600444.SSE', '600446.SSE', '600448.SSE', '600449.SSE', '600452.SSE', '600455.SSE', '600456.SSE', '600458.SSE', '600459.SSE', '600460.SSE', '600461.SSE', '600463.SSE', '600467.SSE', '600468.SSE', '600469.SSE', '600470.SSE', '600475.SSE', '600476.SSE', '600477.SSE', '600478.SSE', '600479.SSE', '600480.SSE', '600481.SSE', '600482.SSE', '600483.SSE', '600486.SSE', '600487.SSE', '600488.SSE', '600489.SSE', '600490.SSE', '600491.SSE', '600493.SSE', '600495.SSE', '600496.SSE', '600497.SSE', '600498.SSE', '600499.SSE', '600500.SSE', '600501.SSE', '600502.SSE', '600503.SSE', '600505.SSE', '600506.SSE', '600507.SSE', '600508.SSE', '600509.SSE', '600510.SSE', '600511.SSE', '600512.SSE', '600513.SSE', '600515.SSE', '600516.SSE', '600517.SSE', '600518.SSE', '600519.SSE', '600520.SSE', '600521.SSE', '600522.SSE', '600523.SSE', '600525.SSE', '600526.SSE', '600527.SSE', '600528.SSE', '600529.SSE', '600530.SSE', '600531.SSE', '600533.SSE', '600535.SSE', '600536.SSE', '600537.SSE', '600538.SSE', '600539.SSE', '600540.SSE', '600543.SSE', '600545.SSE', '600546.SSE', '600547.SSE', '600548.SSE', '600549.SSE', '600550.SSE', '600551.SSE', '600552.SSE', '600556.SSE', '600557.SSE', '600558.SSE', '600559.SSE', '600560.SSE', '600561.SSE', '600562.SSE', '600563.SSE', '600566.SSE', '600567.SSE', '600568.SSE', '600569.SSE', '600570.SSE', '600571.SSE', '600572.SSE', '600573.SSE', '600575.SSE', '600576.SSE', '600577.SSE', '600578.SSE', '600579.SSE', '600580.SSE', '600581.SSE', '600582.SSE', '600583.SSE', '600584.SSE', '600585.SSE', '600586.SSE', '600587.SSE', '600588.SSE', '600589.SSE', '600590.SSE', '600592.SSE', '600593.SSE', '600594.SSE', '600595.SSE', '600596.SSE', '600597.SSE', '600598.SSE', '600599.SSE', '600600.SSE', '600601.SSE', '600602.SSE', '600603.SSE', '600604.SSE', '600605.SSE', '600606.SSE', '600608.SSE', '600609.SSE', '600610.SSE', '600611.SSE', '600612.SSE', '600613.SSE', '600615.SSE', '600616.SSE', '600617.SSE', '600618.SSE', '600619.SSE', '600620.SSE', '600621.SSE', '600622.SSE', '600623.SSE', '600624.SSE', '600626.SSE', '600628.SSE', '600629.SSE', '600630.SSE', '600633.SSE', '600635.SSE', '600636.SSE', '600637.SSE', '600638.SSE', '600639.SSE', '600640.SSE', '600641.SSE', '600642.SSE', '600643.SSE', '600644.SSE', '600645.SSE', '600648.SSE', '600649.SSE', '600650.SSE', '600651.SSE', '600653.SSE', '600654.SSE', '600655.SSE', '600657.SSE', '600658.SSE', '600660.SSE', '600661.SSE', '600662.SSE', '600663.SSE', '600664.SSE', '600665.SSE', '600666.SSE', '600667.SSE', '600668.SSE', '600671.SSE', '600673.SSE', '600674.SSE', '600675.SSE', '600676.SSE', '600678.SSE', '600679.SSE', '600681.SSE', '600682.SSE', '600683.SSE', '600684.SSE', '600685.SSE', '600686.SSE', '600688.SSE', '600689.SSE', '600690.SSE', '600691.SSE', '600692.SSE', '600693.SSE', '600694.SSE', '600696.SSE', '600697.SSE', '600698.SSE', '600699.SSE', '600702.SSE', '600703.SSE', '600704.SSE', '600706.SSE', '600707.SSE', '600708.SSE', '600710.SSE', '600711.SSE', '600712.SSE', '600713.SSE', '600714.SSE', '600715.SSE', '600716.SSE', '600717.SSE', '600718.SSE', '600719.SSE', '600720.SSE', '600721.SSE', '600722.SSE', '600724.SSE', '600725.SSE', '600726.SSE', '600727.SSE', '600728.SSE', '600729.SSE', '600730.SSE', '600731.SSE', '600732.SSE', '600733.SSE', '600734.SSE', '600735.SSE', '600736.SSE', '600737.SSE', '600738.SSE', '600739.SSE', '600740.SSE', '600741.SSE', '600742.SSE', '600743.SSE', '600744.SSE', '600745.SSE', '600746.SSE', '600748.SSE', '600749.SSE', '600750.SSE', '600751.SSE', '600753.SSE', '600754.SSE', '600755.SSE', '600756.SSE', '600757.SSE', '600758.SSE', '600759.SSE', '600760.SSE', '600761.SSE', '600763.SSE', '600764.SSE', '600765.SSE', '600768.SSE', '600769.SSE', '600770.SSE', '600771.SSE', '600773.SSE', '600774.SSE', '600775.SSE', '600776.SSE', '600777.SSE', '600778.SSE', '600779.SSE', '600780.SSE', '600782.SSE', '600783.SSE', '600784.SSE', '600785.SSE', '600787.SSE', '600789.SSE', '600790.SSE', '600791.SSE', '600792.SSE', '600793.SSE', '600794.SSE', '600795.SSE', '600796.SSE', '600797.SSE', '600798.SSE', '600800.SSE', '600801.SSE', '600802.SSE', '600803.SSE', '600805.SSE', '600807.SSE', '600808.SSE', '600809.SSE', '600810.SSE', '600812.SSE', '600814.SSE', '600815.SSE', '600816.SSE', '600817.SSE', '600818.SSE', '600819.SSE', '600820.SSE', '600821.SSE', '600822.SSE', '600824.SSE', '600825.SSE', '600826.SSE', '600827.SSE', '600828.SSE', '600829.SSE', '600830.SSE', '600831.SSE', '600833.SSE', '600834.SSE', '600835.SSE', '600838.SSE', '600839.SSE', '600841.SSE', '600843.SSE', '600844.SSE', '600845.SSE', '600846.SSE', '600847.SSE', '600848.SSE', '600850.SSE', '600851.SSE', '600853.SSE', '600854.SSE', '600855.SSE', '600857.SSE', '600858.SSE', '600859.SSE', '600860.SSE', '600861.SSE', '600862.SSE', '600863.SSE', '600864.SSE', '600865.SSE', '600866.SSE', '600867.SSE', '600868.SSE', '600869.SSE', '600871.SSE', '600872.SSE', '600873.SSE', '600874.SSE', '600875.SSE', '600876.SSE', '600877.SSE', '600879.SSE', '600880.SSE', '600881.SSE', '600882.SSE', '600883.SSE', '600884.SSE', '600885.SSE', '600886.SSE', '600887.SSE', '600888.SSE', '600889.SSE', '600892.SSE', '600893.SSE', '600894.SSE', '600895.SSE', '600897.SSE', '600900.SSE', '600901.SSE', '600903.SSE', '600905.SSE', '600906.SSE', '600908.SSE', '600909.SSE', '600916.SSE', '600917.SSE', '600918.SSE', '600919.SSE', '600925.SSE', '600926.SSE', '600927.SSE', '600928.SSE', '600929.SSE', '600930.SSE', '600933.SSE', '600935.SSE', '600936.SSE', '600938.SSE', '600939.SSE', '600941.SSE', '600955.SSE', '600956.SSE', '600958.SSE', '600959.SSE', '600960.SSE', '600961.SSE', '600962.SSE', '600963.SSE', '600965.SSE', '600966.SSE', '600967.SSE', '600968.SSE', '600969.SSE', '600970.SSE', '600971.SSE', '600973.SSE', '600975.SSE', '600976.SSE', '600977.SSE', '600979.SSE', '600980.SSE', '600981.SSE', '600982.SSE', '600983.SSE', '600984.SSE', '600985.SSE', '600986.SSE', '600987.SSE', '600988.SSE', '600989.SSE', '600990.SSE', '600992.SSE', '600993.SSE', '600995.SSE', '600996.SSE', '600997.SSE', '600998.SSE', '600999.SSE', '601000.SSE', '601001.SSE', '601002.SSE', '601003.SSE', '601005.SSE', '601006.SSE', '601007.SSE', '601008.SSE', '601009.SSE', '601010.SSE', '601011.SSE', '601012.SSE', '601015.SSE', '601016.SSE', '601018.SSE', '601019.SSE', '601020.SSE', '601021.SSE', '601022.SSE', '601033.SSE', '601038.SSE', '601058.SSE', '601059.SSE', '601061.SSE', '601065.SSE', '601066.SSE', '601068.SSE', '601069.SSE', '601077.SSE', '601083.SSE', '601086.SSE', '601088.SSE', '601089.SSE', '601096.SSE', '601098.SSE', '601099.SSE', '601100.SSE', '601101.SSE', '601106.SSE', '601107.SSE', '601108.SSE', '601111.SSE', '601113.SSE', '601116.SSE', '601117.SSE', '601118.SSE', '601121.SSE', '601126.SSE', '601127.SSE', '601128.SSE', '601133.SSE', '601136.SSE', '601137.SSE', '601138.SSE', '601139.SSE', '601155.SSE', '601156.SSE', '601158.SSE', '601162.SSE', '601163.SSE', '601166.SSE', '601168.SSE', '601169.SSE', '601177.SSE', '601179.SSE', '601186.SSE', '601187.SSE', '601188.SSE', '601198.SSE', '601199.SSE', '601200.SSE', '601208.SSE', '601211.SSE', '601212.SSE', '601216.SSE', '601218.SSE', '601222.SSE', '601225.SSE', '601226.SSE', '601228.SSE', '601229.SSE', '601231.SSE', '601233.SSE', '601236.SSE', '601238.SSE', '601279.SSE', '601288.SSE', '601298.SSE', '601311.SSE', '601318.SSE', '601319.SSE', '601326.SSE', '601328.SSE', '601330.SSE', '601333.SSE', '601336.SSE', '601339.SSE', '601360.SSE', '601366.SSE', '601368.SSE', '601369.SSE', '601375.SSE', '601377.SSE', '601388.SSE', '601390.SSE', '601398.SSE', '601399.SSE', '601456.SSE', '601500.SSE', '601512.SSE', '601515.SSE', '601518.SSE', '601519.SSE', '601528.SSE', '601555.SSE', '601566.SSE', '601567.SSE', '601568.SSE', '601577.SSE', '601579.SSE', '601588.SSE', '601595.SSE', '601598.SSE', '601599.SSE', '601600.SSE', '601601.SSE', '601606.SSE', '601607.SSE', '601608.SSE', '601609.SSE', '601611.SSE', '601615.SSE', '601616.SSE', '601618.SSE', '601619.SSE', '601628.SSE', '601633.SSE', '601636.SSE', '601658.SSE', '601665.SSE', '601666.SSE', '601668.SSE', '601669.SSE', '601677.SSE', '601678.SSE', '601686.SSE', '601688.SSE', '601689.SSE', '601696.SSE', '601698.SSE', '601699.SSE', '601700.SSE', '601702.SSE', '601717.SSE', '601718.SSE', '601727.SSE', '601728.SSE', '601766.SSE', '601777.SSE', '601778.SSE', '601788.SSE', '601789.SSE', '601798.SSE', '601799.SSE', '601800.SSE', '601801.SSE', '601808.SSE', '601811.SSE', '601816.SSE', '601818.SSE', '601825.SSE', '601827.SSE', '601828.SSE', '601838.SSE', '601857.SSE', '601858.SSE', '601860.SSE', '601865.SSE', '601866.SSE', '601868.SSE', '601869.SSE', '601872.SSE', '601877.SSE', '601878.SSE', '601880.SSE', '601881.SSE', '601882.SSE', '601886.SSE', '601888.SSE', '601890.SSE', '601898.SSE', '601899.SSE', '601900.SSE', '601901.SSE', '601908.SSE', '601916.SSE', '601918.SSE', '601919.SSE', '601921.SSE', '601928.SSE', '601929.SSE', '601933.SSE', '601939.SSE', '601949.SSE', '601952.SSE', '601956.SSE', '601958.SSE', '601963.SSE', '601965.SSE', '601966.SSE', '601968.SSE', '601969.SSE', '601975.SSE', '601985.SSE', '601988.SSE', '601989.SSE', '601990.SSE', '601991.SSE', '601992.SSE', '601995.SSE', '601996.SSE', '601997.SSE', '601998.SSE', '601999.SSE', '603000.SSE', '603001.SSE', '603002.SSE', '603004.SSE', '603005.SSE', '603006.SSE', '603007.SSE', '603008.SSE', '603009.SSE', '603010.SSE', '603011.SSE', '603012.SSE', '603013.SSE', '603014.SSE', '603015.SSE', '603016.SSE', '603017.SSE', '603018.SSE', '603019.SSE', '603020.SSE', '603021.SSE', '603022.SSE', '603023.SSE', '603025.SSE', '603026.SSE', '603027.SSE', '603028.SSE', '603029.SSE', '603030.SSE', '603031.SSE', '603032.SSE', '603033.SSE', '603035.SSE', '603036.SSE', '603037.SSE', '603038.SSE', '603039.SSE', '603040.SSE', '603041.SSE', '603042.SSE', '603043.SSE', '603045.SSE', '603048.SSE', '603049.SSE', '603050.SSE', '603051.SSE', '603052.SSE', '603053.SSE', '603055.SSE', '603056.SSE', '603057.SSE', '603058.SSE', '603059.SSE', '603060.SSE', '603061.SSE', '603062.SSE', '603063.SSE', '603065.SSE', '603066.SSE', '603067.SSE', '603068.SSE', '603069.SSE', '603070.SSE', '603071.SSE', '603072.SSE', '603073.SSE', '603075.SSE', '603076.SSE', '603077.SSE', '603078.SSE', '603079.SSE', '603080.SSE', '603081.SSE', '603082.SSE', '603083.SSE', '603085.SSE', '603086.SSE', '603087.SSE', '603088.SSE', '603089.SSE', '603090.SSE', '603091.SSE', '603093.SSE', '603095.SSE', '603096.SSE', '603097.SSE', '603098.SSE', '603099.SSE', '603100.SSE', '603101.SSE', '603102.SSE', '603103.SSE', '603105.SSE', '603106.SSE', '603107.SSE', '603108.SSE', '603109.SSE', '603110.SSE', '603111.SSE', '603112.SSE', '603113.SSE', '603115.SSE', '603116.SSE', '603117.SSE', '603118.SSE', '603119.SSE', '603120.SSE', '603121.SSE', '603122.SSE', '603123.SSE', '603124.SSE', '603125.SSE', '603126.SSE', '603127.SSE', '603128.SSE', '603129.SSE', '603130.SSE', '603131.SSE', '603132.SSE', '603135.SSE', '603136.SSE', '603137.SSE', '603138.SSE', '603139.SSE', '603150.SSE', '603151.SSE', '603153.SSE', '603155.SSE', '603156.SSE', '603158.SSE', '603159.SSE', '603160.SSE', '603161.SSE', '603162.SSE', '603163.SSE', '603165.SSE', '603166.SSE', '603167.SSE', '603168.SSE', '603169.SSE', '603170.SSE', '603171.SSE', '603172.SSE', '603173.SSE', '603176.SSE', '603177.SSE', '603178.SSE', '603179.SSE', '603180.SSE', '603181.SSE', '603182.SSE', '603183.SSE', '603185.SSE', '603186.SSE', '603187.SSE', '603188.SSE', '603189.SSE', '603190.SSE', '603191.SSE', '603192.SSE', '603193.SSE', '603194.SSE', '603195.SSE', '603196.SSE', '603197.SSE', '603198.SSE', '603199.SSE', '603200.SSE', '603201.SSE', '603202.SSE', '603203.SSE', '603205.SSE', '603206.SSE', '603207.SSE', '603208.SSE', '603209.SSE', '603210.SSE', '603211.SSE', '603212.SSE', '603213.SSE', '603214.SSE', '603215.SSE', '603216.SSE', '603217.SSE', '603218.SSE', '603219.SSE', '603220.SSE', '603221.SSE', '603222.SSE', '603223.SSE', '603225.SSE', '603226.SSE', '603227.SSE', '603228.SSE', '603229.SSE', '603230.SSE', '603231.SSE', '603232.SSE', '603233.SSE', '603235.SSE', '603236.SSE', '603237.SSE', '603238.SSE', '603239.SSE', '603255.SSE', '603256.SSE', '603257.SSE', '603258.SSE', '603259.SSE', '603260.SSE', '603261.SSE', '603262.SSE', '603266.SSE', '603267.SSE', '603268.SSE', '603269.SSE', '603270.SSE', '603271.SSE', '603272.SSE', '603273.SSE', '603275.SSE', '603276.SSE', '603277.SSE', '603278.SSE', '603279.SSE', '603280.SSE', '603281.SSE', '603282.SSE', '603283.SSE', '603285.SSE', '603286.SSE', '603288.SSE', '603289.SSE', '603290.SSE', '603291.SSE', '603296.SSE', '603297.SSE', '603298.SSE', '603299.SSE', '603300.SSE', '603301.SSE', '603303.SSE', '603305.SSE', '603306.SSE', '603307.SSE', '603308.SSE', '603309.SSE', '603310.SSE', '603311.SSE', '603312.SSE', '603313.SSE', '603315.SSE', '603316.SSE', '603317.SSE', '603318.SSE', '603319.SSE', '603320.SSE', '603321.SSE', '603322.SSE', '603323.SSE', '603324.SSE', '603325.SSE', '603326.SSE', '603327.SSE', '603328.SSE', '603329.SSE', '603330.SSE', '603331.SSE', '603332.SSE', '603333.SSE', '603335.SSE', '603336.SSE', '603337.SSE', '603338.SSE', '603339.SSE', '603341.SSE', '603344.SSE', '603345.SSE', '603348.SSE', '603350.SSE', '603351.SSE', '603353.SSE', '603355.SSE', '603356.SSE', '603357.SSE', '603358.SSE', '603359.SSE', '603360.SSE', '603363.SSE', '603365.SSE', '603366.SSE', '603367.SSE', '603368.SSE', '603369.SSE', '603373.SSE', '603375.SSE', '603377.SSE', '603378.SSE', '603379.SSE', '603380.SSE', '603381.SSE', '603382.SSE', '603383.SSE', '603385.SSE', '603386.SSE', '603387.SSE', '603388.SSE', '603389.SSE', '603390.SSE', '603391.SSE', '603392.SSE', '603393.SSE', '603395.SSE', '603396.SSE', '603398.SSE', '603399.SSE', '603400.SSE', '603408.SSE', '603409.SSE', '603416.SSE', '603421.SSE', '603429.SSE', '603439.SSE', '603444.SSE', '603456.SSE', '603458.SSE', '603466.SSE', '603477.SSE', '603486.SSE', '603488.SSE', '603489.SSE', '603496.SSE', '603499.SSE', '603500.SSE', '603501.SSE', '603505.SSE', '603506.SSE', '603507.SSE', '603508.SSE', '603511.SSE', '603515.SSE', '603516.SSE', '603517.SSE', '603518.SSE', '603519.SSE', '603520.SSE', '603527.SSE', '603528.SSE', '603529.SSE', '603530.SSE', '603533.SSE', '603535.SSE', '603536.SSE', '603538.SSE', '603551.SSE', '603556.SSE', '603557.SSE', '603558.SSE', '603559.SSE', '603565.SSE', '603566.SSE', '603567.SSE', '603568.SSE', '603569.SSE', '603577.SSE', '603578.SSE', '603579.SSE', '603580.SSE', '603583.SSE', '603585.SSE', '603586.SSE', '603587.SSE', '603588.SSE', '603589.SSE', '603590.SSE', '603595.SSE', '603596.SSE', '603598.SSE', '603599.SSE', '603600.SSE', '603601.SSE', '603602.SSE', '603605.SSE', '603606.SSE', '603607.SSE', '603608.SSE', '603609.SSE', '603610.SSE', '603611.SSE', '603612.SSE', '603613.SSE', '603615.SSE', '603616.SSE', '603617.SSE', '603618.SSE', '603619.SSE', '603626.SSE', '603628.SSE', '603629.SSE', '603630.SSE', '603633.SSE', '603636.SSE', '603637.SSE', '603638.SSE', '603639.SSE', '603648.SSE', '603650.SSE', '603655.SSE', '603656.SSE', '603657.SSE', '603658.SSE', '603659.SSE', '603660.SSE', '603661.SSE', '603662.SSE', '603663.SSE', '603665.SSE', '603666.SSE', '603667.SSE', '603668.SSE', '603669.SSE', '603676.SSE', '603677.SSE', '603678.SSE', '603679.SSE', '603680.SSE', '603681.SSE', '603682.SSE', '603683.SSE', '603685.SSE', '603686.SSE', '603687.SSE', '603688.SSE', '603689.SSE', '603690.SSE', '603693.SSE', '603696.SSE', '603697.SSE', '603698.SSE', '603699.SSE', '603700.SSE', '603701.SSE', '603703.SSE', '603706.SSE', '603707.SSE', '603708.SSE', '603709.SSE', '603711.SSE', '603712.SSE', '603713.SSE', '603716.SSE', '603717.SSE', '603718.SSE', '603719.SSE', '603721.SSE', '603722.SSE', '603725.SSE', '603726.SSE', '603727.SSE', '603728.SSE', '603729.SSE', '603730.SSE', '603733.SSE', '603737.SSE', '603738.SSE', '603739.SSE', '603755.SSE', '603757.SSE', '603758.SSE', '603759.SSE', '603766.SSE', '603767.SSE', '603768.SSE', '603773.SSE', '603776.SSE', '603777.SSE', '603778.SSE', '603779.SSE', '603786.SSE', '603787.SSE', '603788.SSE', '603789.SSE', '603790.SSE', '603797.SSE', '603798.SSE', '603799.SSE', '603800.SSE', '603801.SSE', '603803.SSE', '603806.SSE', '603808.SSE', '603809.SSE', '603810.SSE', '603811.SSE', '603813.SSE', '603815.SSE', '603816.SSE', '603817.SSE', '603818.SSE', '603819.SSE', '603822.SSE', '603823.SSE', '603825.SSE', '603826.SSE', '603828.SSE', '603829.SSE', '603833.SSE', '603836.SSE', '603838.SSE', '603839.SSE', '603843.SSE', '603848.SSE', '603855.SSE', '603856.SSE', '603858.SSE', '603859.SSE', '603860.SSE', '603861.SSE', '603863.SSE', '603866.SSE', '603867.SSE', '603868.SSE', '603869.SSE', '603871.SSE', '603876.SSE', '603877.SSE', '603878.SSE', '603879.SSE', '603880.SSE', '603881.SSE', '603882.SSE', '603883.SSE', '603885.SSE', '603886.SSE', '603887.SSE', '603888.SSE', '603889.SSE', '603890.SSE', '603893.SSE', '603895.SSE', '603896.SSE', '603897.SSE', '603898.SSE', '603899.SSE', '603900.SSE', '603901.SSE', '603903.SSE', '603906.SSE', '603908.SSE', '603909.SSE', '603912.SSE', '603915.SSE', '603916.SSE', '603917.SSE', '603918.SSE', '603919.SSE', '603920.SSE', '603922.SSE', '603926.SSE', '603927.SSE', '603928.SSE', '603929.SSE', '603931.SSE', '603933.SSE', '603936.SSE', '603937.SSE', '603938.SSE', '603939.SSE', '603948.SSE', '603949.SSE', '603950.SSE', '603955.SSE', '603956.SSE', '603958.SSE', '603959.SSE', '603960.SSE', '603966.SSE', '603967.SSE', '603968.SSE', '603969.SSE', '603970.SSE', '603976.SSE', '603977.SSE', '603978.SSE', '603979.SSE', '603980.SSE', '603982.SSE', '603983.SSE', '603985.SSE', '603986.SSE', '603987.SSE', '603988.SSE', '603989.SSE', '603990.SSE', '603991.SSE', '603992.SSE', '603993.SSE', '603995.SSE', '603997.SSE', '603998.SSE', '603999.SSE', '605001.SSE', '605003.SSE', '605005.SSE', '605006.SSE', '605007.SSE', '605008.SSE', '605009.SSE', '605011.SSE', '605016.SSE', '605018.SSE', '605020.SSE', '605028.SSE', '605033.SSE', '605050.SSE', '605055.SSE', '605056.SSE', '605058.SSE', '605060.SSE', '605066.SSE', '605068.SSE', '605069.SSE', '605077.SSE', '605080.SSE', '605081.SSE', '605086.SSE', '605088.SSE', '605089.SSE', '605090.SSE', '605098.SSE', '605099.SSE', '605100.SSE', '605108.SSE', '605111.SSE', '605116.SSE', '605117.SSE', '605118.SSE', '605122.SSE', '605123.SSE', '605128.SSE', '605133.SSE', '605136.SSE', '605138.SSE', '605151.SSE', '605155.SSE', '605158.SSE', '605162.SSE', '605166.SSE', '605167.SSE', '605168.SSE', '605169.SSE', '605177.SSE', '605178.SSE', '605179.SSE', '605180.SSE', '605183.SSE', '605186.SSE', '605188.SSE', '605189.SSE', '605196.SSE', '605198.SSE', '605199.SSE', '605208.SSE', '605218.SSE', '605222.SSE', '605228.SSE', '605255.SSE', '605258.SSE', '605259.SSE', '605266.SSE', '605268.SSE', '605277.SSE', '605286.SSE', '605287.SSE', '605288.SSE', '605289.SSE', '605296.SSE', '605298.SSE', '605299.SSE', '605300.SSE', '605303.SSE', '605305.SSE', '605318.SSE', '605319.SSE', '605333.SSE', '605336.SSE', '605337.SSE', '605338.SSE', '605339.SSE', '605358.SSE', '605365.SSE', '605366.SSE', '605368.SSE', '605369.SSE', '605376.SSE', '605377.SSE', '605378.SSE', '605388.SSE', '605389.SSE', '605398.SSE', '605399.SSE', '605488.SSE', '605499.SSE', '605500.SSE', '605507.SSE', '605555.SSE', '605566.SSE', '605567.SSE', '605577.SSE', '605580.SSE', '605588.SSE', '605589.SSE', '605598.SSE', '605599.SSE', '688001.SSE', '688002.SSE', '688003.SSE', '688004.SSE', '688005.SSE', '688006.SSE', '688007.SSE', '688008.SSE', '688009.SSE', '688010.SSE', '688011.SSE', '688012.SSE', '688013.SSE', '688015.SSE', '688016.SSE', '688017.SSE', '688018.SSE', '688019.SSE', '688020.SSE', '688021.SSE', '688022.SSE', '688023.SSE', '688025.SSE', '688026.SSE', '688027.SSE', '688028.SSE', '688029.SSE', '688030.SSE', '688031.SSE', '688032.SSE', '688033.SSE', '688035.SSE', '688036.SSE', '688037.SSE', '688038.SSE', '688039.SSE', '688041.SSE', '688045.SSE', '688046.SSE', '688047.SSE', '688048.SSE', '688049.SSE', '688050.SSE', '688051.SSE', '688052.SSE', '688053.SSE', '688055.SSE', '688056.SSE', '688057.SSE', '688058.SSE', '688059.SSE', '688060.SSE', '688061.SSE', '688062.SSE', '688063.SSE', '688065.SSE', '688066.SSE', '688067.SSE', '688068.SSE', '688069.SSE', '688070.SSE', '688071.SSE', '688072.SSE', '688073.SSE', '688075.SSE', '688076.SSE', '688077.SSE', '688078.SSE', '688079.SSE', '688080.SSE', '688081.SSE', '688082.SSE', '688083.SSE', '688084.SSE', '688085.SSE', '688087.SSE', '688088.SSE', '688089.SSE', '688090.SSE', '688091.SSE', '688092.SSE', '688093.SSE', '688095.SSE', '688096.SSE', '688097.SSE', '688098.SSE', '688099.SSE', '688100.SSE', '688101.SSE', '688102.SSE', '688103.SSE', '688105.SSE', '688106.SSE', '688107.SSE', '688108.SSE', '688109.SSE', '688110.SSE', '688111.SSE', '688112.SSE', '688113.SSE', '688114.SSE', '688115.SSE', '688116.SSE', '688117.SSE', '688118.SSE', '688119.SSE', '688120.SSE', '688121.SSE', '688122.SSE', '688123.SSE', '688125.SSE', '688126.SSE', '688127.SSE', '688128.SSE', '688129.SSE', '688130.SSE', '688131.SSE', '688132.SSE', '688133.SSE', '688135.SSE', '688136.SSE', '688137.SSE', '688138.SSE', '688139.SSE', '688141.SSE', '688143.SSE', '688146.SSE', '688147.SSE', '688148.SSE', '688150.SSE', '688151.SSE', '688152.SSE', '688153.SSE', '688155.SSE', '688156.SSE', '688157.SSE', '688158.SSE', '688159.SSE', '688160.SSE', '688161.SSE', '688162.SSE', '688163.SSE', '688165.SSE', '688166.SSE', '688167.SSE', '688168.SSE', '688169.SSE', '688170.SSE', '688171.SSE', '688172.SSE', '688173.SSE', '688175.SSE', '688176.SSE', '688177.SSE', '688178.SSE', '688179.SSE', '688180.SSE', '688181.SSE', '688182.SSE', '688183.SSE', '688184.SSE', '688185.SSE', '688186.SSE', '688187.SSE', '688188.SSE', '688189.SSE', '688190.SSE', '688191.SSE', '688192.SSE', '688193.SSE', '688195.SSE', '688196.SSE', '688197.SSE', '688198.SSE', '688199.SSE', '688200.SSE', '688201.SSE', '688202.SSE', '688203.SSE', '688205.SSE', '688206.SSE', '688207.SSE', '688208.SSE', '688209.SSE', '688210.SSE', '688211.SSE', '688212.SSE', '688213.SSE', '688215.SSE', '688216.SSE', '688217.SSE', '688218.SSE', '688219.SSE', '688220.SSE', '688221.SSE', '688222.SSE', '688223.SSE', '688225.SSE', '688226.SSE', '688227.SSE', '688228.SSE', '688229.SSE', '688230.SSE', '688231.SSE', '688232.SSE', '688233.SSE', '688234.SSE', '688235.SSE', '688236.SSE', '688237.SSE', '688238.SSE', '688239.SSE', '688244.SSE', '688246.SSE', '688247.SSE', '688248.SSE', '688249.SSE', '688251.SSE', '688252.SSE', '688253.SSE', '688255.SSE', '688256.SSE', '688257.SSE', '688258.SSE', '688259.SSE', '688260.SSE', '688261.SSE', '688262.SSE', '688265.SSE', '688266.SSE', '688267.SSE', '688268.SSE', '688269.SSE', '688270.SSE', '688271.SSE', '688272.SSE', '688273.SSE', '688275.SSE', '688276.SSE', '688277.SSE', '688278.SSE', '688279.SSE', '688280.SSE', '688281.SSE', '688282.SSE', '688283.SSE', '688285.SSE', '688286.SSE', '688287.SSE', '688288.SSE', '688289.SSE', '688290.SSE', '688291.SSE', '688292.SSE', '688293.SSE', '688295.SSE', '688296.SSE', '688297.SSE', '688298.SSE', '688299.SSE', '688300.SSE', '688301.SSE', '688302.SSE', '688303.SSE', '688305.SSE', '688306.SSE', '688307.SSE', '688308.SSE', '688309.SSE', '688310.SSE', '688311.SSE', '688312.SSE', '688313.SSE', '688314.SSE', '688315.SSE', '688316.SSE', '688317.SSE', '688318.SSE', '688319.SSE', '688320.SSE', '688321.SSE', '688322.SSE', '688323.SSE', '688325.SSE', '688326.SSE', '688327.SSE', '688328.SSE', '688329.SSE', '688330.SSE', '688331.SSE', '688332.SSE', '688333.SSE', '688334.SSE', '688335.SSE', '688336.SSE', '688337.SSE', '688338.SSE', '688339.SSE', '688343.SSE', '688345.SSE', '688347.SSE', '688348.SSE', '688349.SSE', '688350.SSE', '688351.SSE', '688352.SSE', '688353.SSE', '688355.SSE', '688356.SSE', '688357.SSE', '688358.SSE', '688359.SSE', '688360.SSE', '688361.SSE', '688362.SSE', '688363.SSE', '688365.SSE', '688366.SSE', '688367.SSE', '688368.SSE', '688369.SSE', '688370.SSE', '688371.SSE', '688372.SSE', '688373.SSE', '688375.SSE', '688376.SSE', '688377.SSE', '688378.SSE', '688379.SSE', '688380.SSE', '688381.SSE', '688382.SSE', '688383.SSE', '688385.SSE', '688386.SSE', '688387.SSE', '688388.SSE', '688389.SSE', '688390.SSE', '688391.SSE', '688392.SSE', '688393.SSE', '688395.SSE', '688396.SSE', '688398.SSE', '688399.SSE', '688400.SSE', '688401.SSE', '688403.SSE', '688408.SSE', '688409.SSE', '688410.SSE', '688411.SSE', '688416.SSE', '688418.SSE', '688419.SSE', '688420.SSE', '688425.SSE', '688426.SSE', '688428.SSE', '688429.SSE', '688432.SSE', '688433.SSE', '688435.SSE', '688439.SSE', '688443.SSE', '688448.SSE', '688449.SSE', '688450.SSE', '688455.SSE', '688456.SSE', '688458.SSE', '688459.SSE', '688466.SSE', '688468.SSE', '688469.SSE', '688472.SSE', '688475.SSE', '688478.SSE', '688479.SSE', '688480.SSE', '688484.SSE', '688485.SSE', '688486.SSE', '688488.SSE', '688489.SSE', '688496.SSE', '688498.SSE', '688499.SSE', '688500.SSE', '688501.SSE', '688502.SSE', '688503.SSE', '688505.SSE', '688506.SSE', '688507.SSE', '688508.SSE', '688509.SSE', '688510.SSE', '688511.SSE', '688512.SSE', '688513.SSE', '688515.SSE', '688516.SSE', '688517.SSE', '688518.SSE', '688519.SSE', '688520.SSE', '688521.SSE', '688522.SSE', '688523.SSE', '688525.SSE', '688526.SSE', '688528.SSE', '688529.SSE', '688530.SSE', '688531.SSE', '688533.SSE', '688535.SSE', '688536.SSE', '688538.SSE', '688539.SSE', '688543.SSE', '688545.SSE', '688548.SSE', '688549.SSE', '688550.SSE', '688551.SSE', '688552.SSE', '688553.SSE', '688556.SSE', '688557.SSE', '688558.SSE', '688559.SSE', '688560.SSE', '688561.SSE', '688562.SSE', '688563.SSE', '688565.SSE', '688566.SSE', '688567.SSE', '688568.SSE', '688569.SSE', '688570.SSE', '688571.SSE', '688573.SSE', '688575.SSE', '688576.SSE', '688577.SSE', '688578.SSE', '688579.SSE', '688580.SSE', '688581.SSE', '688582.SSE', '688583.SSE', '688584.SSE', '688585.SSE', '688586.SSE', '688588.SSE', '688589.SSE', '688590.SSE', '688591.SSE', '688592.SSE', '688593.SSE', '688595.SSE', '688596.SSE', '688597.SSE', '688598.SSE', '688599.SSE', '688600.SSE', '688601.SSE', '688602.SSE', '688603.SSE', '688605.SSE', '688606.SSE', '688607.SSE', '688608.SSE', '688609.SSE', '688610.SSE', '688611.SSE', '688612.SSE', '688613.SSE', '688615.SSE', '688616.SSE', '688617.SSE', '688618.SSE', '688619.SSE', '688620.SSE', '688621.SSE', '688622.SSE', '688623.SSE', '688625.SSE', '688626.SSE', '688627.SSE', '688628.SSE', '688629.SSE', '688630.SSE', '688631.SSE', '688633.SSE', '688636.SSE', '688638.SSE', '688639.SSE', '688646.SSE', '688648.SSE', '688651.SSE', '688652.SSE', '688653.SSE', '688655.SSE', '688656.SSE', '688657.SSE', '688658.SSE', '688659.SSE', '688660.SSE', '688661.SSE', '688662.SSE', '688663.SSE', '688665.SSE', '688667.SSE', '688668.SSE', '688669.SSE', '688670.SSE', '688671.SSE', '688676.SSE', '688677.SSE', '688678.SSE', '688679.SSE', '688680.SSE', '688681.SSE', '688682.SSE', '688683.SSE', '688685.SSE', '688686.SSE', '688687.SSE', '688689.SSE', '688690.SSE', '688691.SSE', '688692.SSE', '688693.SSE', '688695.SSE', '688696.SSE', '688697.SSE', '688698.SSE', '688699.SSE', '688700.SSE', '688701.SSE', '688702.SSE', '688707.SSE', '688708.SSE', '688709.SSE', '688710.SSE', '688711.SSE', '688716.SSE', '688717.SSE', '688718.SSE', '688719.SSE', '688720.SSE', '688721.SSE', '688722.SSE', '688726.SSE', '688728.SSE', '688729.SSE', '688733.SSE', '688737.SSE', '688739.SSE', '688750.SSE', '688755.SSE', '688757.SSE', '688758.SSE', '688766.SSE', '688767.SSE', '688768.SSE', '688772.SSE', '688775.SSE', '688776.SSE', '688777.SSE', '688778.SSE', '688779.SSE', '688786.SSE', '688787.SSE', '688788.SSE', '688789.SSE', '688793.SSE', '688798.SSE', '688799.SSE', '688800.SSE', '688819.SSE', '688981.SSE', '689009.SSE', '830779.BSE', '830809.BSE', '830832.BSE', '830839.BSE', '830879.BSE', '830896.BSE', '830946.BSE', '830964.BSE', '830974.BSE', '831010.BSE', '831039.BSE', '831087.BSE', '831152.BSE', '831167.BSE', '831175.BSE', '831195.BSE', '831278.BSE', '831304.BSE', '831305.BSE', '831370.BSE', '831396.BSE', '831526.BSE', '831627.BSE', '831641.BSE', '831689.BSE', '831726.BSE', '831768.BSE', '831832.BSE', '831834.BSE', '831855.BSE', '831856.BSE', '831906.BSE', '831961.BSE', '832000.BSE', '832023.BSE', '832089.BSE', '832110.BSE', '832145.BSE', '832149.BSE', '832171.BSE', '832175.BSE', '832225.BSE', '832278.BSE', '832419.BSE', '832469.BSE', '832471.BSE', '832491.BSE', '832522.BSE', '832566.BSE', '832651.BSE', '832662.BSE', '832735.BSE', '832786.BSE', '832802.BSE', '832876.BSE', '832885.BSE', '832978.BSE', '832982.BSE', '833030.BSE', '833075.BSE', '833171.BSE', '833230.BSE', '833266.BSE', '833284.BSE', '833346.BSE', '833394.BSE', '833427.BSE', '833429.BSE', '833454.BSE', '833455.BSE', '833509.BSE', '833523.BSE', '833533.BSE', '833575.BSE', '833580.BSE', '833751.BSE', '833781.BSE', '833873.BSE', '833914.BSE', '833943.BSE', '834014.BSE', '834021.BSE', '834033.BSE', '834058.BSE', '834062.BSE', '834261.BSE', '834407.BSE', '834415.BSE', '834475.BSE', '834599.BSE', '834639.BSE', '834765.BSE', '834770.BSE', '834950.BSE', '835174.BSE', '835179.BSE', '835184.BSE', '835185.BSE', '835207.BSE', '835237.BSE', '835305.BSE', '835368.BSE', '835438.BSE', '835508.BSE', '835579.BSE', '835640.BSE', '835670.BSE', '835857.BSE', '835892.BSE', '835985.BSE', '836077.BSE', '836149.BSE', '836208.BSE', '836221.BSE', '836239.BSE', '836247.BSE', '836260.BSE', '836263.BSE', '836270.BSE', '836395.BSE', '836414.BSE', '836419.BSE', '836422.BSE', '836433.BSE', '836504.BSE', '836547.BSE', '836675.BSE', '836699.BSE', '836717.BSE', '836720.BSE', '836807.BSE', '836826.BSE', '836871.BSE', '836892.BSE', '836942.BSE', '836957.BSE', '836961.BSE', '837006.BSE', '837023.BSE', '837046.BSE', '837092.BSE', '837174.BSE', '837212.BSE', '837242.BSE', '837344.BSE', '837403.BSE', '837592.BSE', '837663.BSE', '837748.BSE', '837821.BSE', '838030.BSE', '838163.BSE', '838171.BSE', '838227.BSE', '838262.BSE', '838275.BSE', '838402.BSE', '838670.BSE', '838701.BSE', '838810.BSE', '838837.BSE', '838924.BSE', '838971.BSE', '839273.BSE', '839371.BSE', '839493.BSE', '839680.BSE', '839719.BSE', '839725.BSE', '839729.BSE', '839790.BSE', '839792.BSE', '839946.BSE', '870199.BSE', '870204.BSE', '870299.BSE', '870357.BSE', '870436.BSE', '870508.BSE', '870656.BSE', '870726.BSE', '870866.BSE', '870976.BSE', '871245.BSE', '871263.BSE', '871396.BSE', '871478.BSE', '871553.BSE', '871634.BSE', '871642.BSE', '871694.BSE', '871753.BSE', '871857.BSE', '871970.BSE', '871981.BSE', '872190.BSE', '872351.BSE', '872374.BSE', '872392.BSE', '872541.BSE', '872808.BSE', '872895.BSE', '872925.BSE', '872931.BSE', '872953.BSE', '873001.BSE', '873122.BSE', '873132.BSE', '873152.BSE', '873167.BSE', '873169.BSE', '873223.BSE', '873305.BSE', '873339.BSE', '873527.BSE', '873570.BSE', '873576.BSE', '873593.BSE', '873665.BSE', '873679.BSE', '873690.BSE', '873693.BSE', '873703.BSE', '873706.BSE', '873726.BSE', '873806.BSE', '873833.BSE', '920002.BSE', '920008.BSE', '920016.BSE', '920019.BSE', '920027.BSE', '920029.BSE', '920037.BSE', '920060.BSE', '920066.BSE', '920068.BSE', '920082.BSE', '920088.BSE', '920098.BSE', '920099.BSE', '920106.BSE', '920108.BSE', '920111.BSE', '920116.BSE', '920118.BSE', '920128.BSE', '920167.BSE', '920445.BSE', '920489.BSE', '920682.BSE', '920799.BSE', '920819.BSE']\n"
     ]
    }
   ],
   "source": [
    "conn = pymysql.connect(\n",
    "            host=\"127.0.0.1\",\n",
    "            port=3306,\n",
    "            user=\"root\",\n",
    "            password=\"12345678\",\n",
    "            database=\"vnpy\",\n",
    "            charset='utf8mb4',\n",
    "            cursorclass=pymysql.cursors.DictCursor\n",
    "        )\n",
    "loadBasicStockSql = \"\"\"select * from stock_basic where ts_code like '%BJ' or ts_code like '6%';\"\"\"\n",
    "cursor = conn.cursor()\n",
    "cursor.execute(loadBasicStockSql)\n",
    "results = cursor.fetchall()\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "# 要下载数据的合约代码\n",
    "# vt_symbols = [\n",
    "#     \"IF2501.CFFEX\",\n",
    "#     \"IF2502.CFFEX\",\n",
    "#     \"IF2503.CFFEX\",\n",
    "\n",
    "#     \"IH2501.CFFEX\",\n",
    "#     \"IH2502.CFFEX\",\n",
    "#     \"IH2503.CFFEX\",\n",
    "\n",
    "#     \"IC2501.CFFEX\",\n",
    "#     \"IC2502.CFFEX\",\n",
    "#     \"IC2503.CFFEX\",\n",
    "\n",
    "#     \"IM2501.CFFEX\",\n",
    "#     \"IM2502.CFFEX\",\n",
    "#     \"IM2503.CFFEX\",\n",
    "# ]\n",
    "ts_code_lists = [result['ts_code'] for result in results]\n",
    "#ts_code_list实现replace(\"SH\", \"SSE\").replace(\"SZ\", \"SZSE\")\n",
    "vt_symbols = [vt_symbol.replace(\"SH\", \"SSE\").replace(\"SZ\", \"SZSE\").replace(\"BJ\", \"BSE\") for vt_symbol in ts_code_lists]\n",
    "\n",
    "\n",
    "print(vt_symbols)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "start: 2025-08-13 00:00:00\n",
      "end: 2025-08-17 21:57:03.776916\n"
     ]
    }
   ],
   "source": [
    "# 要下载数据的起止时间\n",
    "lastTimeSql = \"SELECT max(end) as lastTime FROM dbbaroverview;\"\n",
    "cursor = conn.cursor()\n",
    "cursor.execute(lastTimeSql)\n",
    "lastTime_result = cursor.fetchall()\n",
    "\n",
    "\n",
    "#start = lastTime_result[0]['lastTime']\n",
    "start = datetime(2020, 1, 1)\n",
    "end = datetime.now()\n",
    "print(\"start:\", start)\n",
    "print(\"end:\", end)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "ename": "KeyboardInterrupt",
     "evalue": "",
     "output_type": "error",
     "traceback": [
      "\u001b[31m---------------------------------------------------------------------------\u001b[39m",
      "\u001b[31mTimeoutError\u001b[39m                              Traceback (most recent call last)",
      "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\80569\\miniconda3\\envs\\vnpy\\Lib\\site-packages\\urllib3\\util\\connection.py:73\u001b[39m, in \u001b[36mcreate_connection\u001b[39m\u001b[34m(address, timeout, source_address, socket_options)\u001b[39m\n\u001b[32m     72\u001b[39m     sock.bind(source_address)\n\u001b[32m---> \u001b[39m\u001b[32m73\u001b[39m \u001b[43msock\u001b[49m\u001b[43m.\u001b[49m\u001b[43mconnect\u001b[49m\u001b[43m(\u001b[49m\u001b[43msa\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m     74\u001b[39m \u001b[38;5;66;03m# Break explicitly a reference cycle\u001b[39;00m\n",
      "\u001b[31mTimeoutError\u001b[39m: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应，连接尝试失败。",
      "\nDuring handling of the above exception, another exception occurred:\n",
      "\u001b[31mKeyboardInterrupt\u001b[39m                         Traceback (most recent call last)",
      "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[7]\u001b[39m\u001b[32m, line 16\u001b[39m\n\u001b[32m      7\u001b[39m req: HistoryRequest = HistoryRequest(\n\u001b[32m      8\u001b[39m     symbol=symbol,\n\u001b[32m      9\u001b[39m     exchange=exchange,\n\u001b[32m   (...)\u001b[39m\u001b[32m     12\u001b[39m     interval=Interval.DAILY        \u001b[38;5;66;03m# 这里下载最常用的1分钟K线\u001b[39;00m\n\u001b[32m     13\u001b[39m )\n\u001b[32m     15\u001b[39m \u001b[38;5;66;03m# 从数据服务下载数据\u001b[39;00m\n\u001b[32m---> \u001b[39m\u001b[32m16\u001b[39m bars: \u001b[38;5;28mlist\u001b[39m[BarData] = \u001b[43mdatafeed\u001b[49m\u001b[43m.\u001b[49m\u001b[43mquery_bar_history\u001b[49m\u001b[43m(\u001b[49m\u001b[43mreq\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m     18\u001b[39m \u001b[38;5;66;03m# 如果下载成功则保存\u001b[39;00m\n\u001b[32m     19\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m bars:\n",
      "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\80569\\miniconda3\\envs\\vnpy\\Lib\\site-packages\\vnpy_tushare\\tushare_datafeed.py:176\u001b[39m, in \u001b[36mTushareDatafeed.query_bar_history\u001b[39m\u001b[34m(self, req, output)\u001b[39m\n\u001b[32m    173\u001b[39m adjustment: timedelta = INTERVAL_ADJUSTMENT_MAP[interval]\n\u001b[32m    175\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m176\u001b[39m     d1: DataFrame = \u001b[43mts\u001b[49m\u001b[43m.\u001b[49m\u001b[43mpro_bar\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m    177\u001b[39m \u001b[43m        \u001b[49m\u001b[43mts_code\u001b[49m\u001b[43m=\u001b[49m\u001b[43mts_symbol\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    178\u001b[39m \u001b[43m        \u001b[49m\u001b[43mstart_date\u001b[49m\u001b[43m=\u001b[49m\u001b[43mstart\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    179\u001b[39m \u001b[43m        \u001b[49m\u001b[43mend_date\u001b[49m\u001b[43m=\u001b[49m\u001b[43mend\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    180\u001b[39m \u001b[43m        \u001b[49m\u001b[43masset\u001b[49m\u001b[43m=\u001b[49m\u001b[43masset\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    181\u001b[39m \u001b[43m        \u001b[49m\u001b[43mfreq\u001b[49m\u001b[43m=\u001b[49m\u001b[43mts_interval\u001b[49m\n\u001b[32m    182\u001b[39m \u001b[43m    \u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m    183\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mOSError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m ex:\n\u001b[32m    184\u001b[39m     output(\u001b[33mf\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m发生输入/输出错误：\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mex.strerror\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m\"\u001b[39m)\n",
      "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\80569\\miniconda3\\envs\\vnpy\\Lib\\site-packages\\tushare\\pro\\data_pro.py:104\u001b[39m, in \u001b[36mpro_bar\u001b[39m\u001b[34m(ts_code, api, start_date, end_date, freq, asset, exchange, adj, ma, factors, adjfactor, offset, limit, fields, contract_type, retry_count)\u001b[39m\n\u001b[32m    102\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m asset == \u001b[33m'\u001b[39m\u001b[33mE\u001b[39m\u001b[33m'\u001b[39m:\n\u001b[32m    103\u001b[39m     \u001b[38;5;28;01mif\u001b[39;00m freq == \u001b[33m'\u001b[39m\u001b[33mD\u001b[39m\u001b[33m'\u001b[39m:\n\u001b[32m--> \u001b[39m\u001b[32m104\u001b[39m         data = \u001b[43mapi\u001b[49m\u001b[43m.\u001b[49m\u001b[43mdaily\u001b[49m\u001b[43m(\u001b[49m\u001b[43mts_code\u001b[49m\u001b[43m=\u001b[49m\u001b[43mts_code\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstart_date\u001b[49m\u001b[43m=\u001b[49m\u001b[43mstart_date\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mend_date\u001b[49m\u001b[43m=\u001b[49m\u001b[43mend_date\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43moffset\u001b[49m\u001b[43m=\u001b[49m\u001b[43moffset\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mlimit\u001b[49m\u001b[43m=\u001b[49m\u001b[43mlimit\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m    105\u001b[39m         \u001b[38;5;28;01mif\u001b[39;00m factors \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(factors) >\u001b[32m0\u001b[39m :\n\u001b[32m    106\u001b[39m             ds = api.daily_basic(ts_code=ts_code, start_date=start_date, end_date=end_date)[[\u001b[33m'\u001b[39m\u001b[33mtrade_date\u001b[39m\u001b[33m'\u001b[39m, \u001b[33m'\u001b[39m\u001b[33mturnover_rate\u001b[39m\u001b[33m'\u001b[39m, \u001b[33m'\u001b[39m\u001b[33mvolume_ratio\u001b[39m\u001b[33m'\u001b[39m]]\n",
      "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\80569\\miniconda3\\envs\\vnpy\\Lib\\site-packages\\tushare\\pro\\client.py:41\u001b[39m, in \u001b[36mDataApi.query\u001b[39m\u001b[34m(self, api_name, fields, **kwargs)\u001b[39m\n\u001b[32m     33\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34mquery\u001b[39m(\u001b[38;5;28mself\u001b[39m, api_name, fields=\u001b[33m'\u001b[39m\u001b[33m'\u001b[39m, **kwargs):\n\u001b[32m     34\u001b[39m     req_params = {\n\u001b[32m     35\u001b[39m         \u001b[33m'\u001b[39m\u001b[33mapi_name\u001b[39m\u001b[33m'\u001b[39m: api_name,\n\u001b[32m     36\u001b[39m         \u001b[33m'\u001b[39m\u001b[33mtoken\u001b[39m\u001b[33m'\u001b[39m: \u001b[38;5;28mself\u001b[39m.__token,\n\u001b[32m     37\u001b[39m         \u001b[33m'\u001b[39m\u001b[33mparams\u001b[39m\u001b[33m'\u001b[39m: kwargs,\n\u001b[32m     38\u001b[39m         \u001b[33m'\u001b[39m\u001b[33mfields\u001b[39m\u001b[33m'\u001b[39m: fields\n\u001b[32m     39\u001b[39m     }\n\u001b[32m---> \u001b[39m\u001b[32m41\u001b[39m     res = \u001b[43mrequests\u001b[49m\u001b[43m.\u001b[49m\u001b[43mpost\u001b[49m\u001b[43m(\u001b[49m\u001b[33;43mf\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[38;5;132;43;01m{\u001b[39;49;00m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m__http_url\u001b[49m\u001b[38;5;132;43;01m}\u001b[39;49;00m\u001b[33;43m/\u001b[39;49m\u001b[38;5;132;43;01m{\u001b[39;49;00m\u001b[43mapi_name\u001b[49m\u001b[38;5;132;43;01m}\u001b[39;49;00m\u001b[33;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mjson\u001b[49m\u001b[43m=\u001b[49m\u001b[43mreq_params\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m__timeout\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m     42\u001b[39m     \u001b[38;5;28;01mif\u001b[39;00m res:\n\u001b[32m     43\u001b[39m         result = json.loads(res.text)\n",
      "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\80569\\miniconda3\\envs\\vnpy\\Lib\\site-packages\\requests\\api.py:115\u001b[39m, in \u001b[36mpost\u001b[39m\u001b[34m(url, data, json, **kwargs)\u001b[39m\n\u001b[32m    103\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34mpost\u001b[39m(url, data=\u001b[38;5;28;01mNone\u001b[39;00m, json=\u001b[38;5;28;01mNone\u001b[39;00m, **kwargs):\n\u001b[32m    104\u001b[39m \u001b[38;5;250m    \u001b[39m\u001b[33mr\u001b[39m\u001b[33;03m\"\"\"Sends a POST request.\u001b[39;00m\n\u001b[32m    105\u001b[39m \n\u001b[32m    106\u001b[39m \u001b[33;03m    :param url: URL for the new :class:`Request` object.\u001b[39;00m\n\u001b[32m   (...)\u001b[39m\u001b[32m    112\u001b[39m \u001b[33;03m    :rtype: requests.Response\u001b[39;00m\n\u001b[32m    113\u001b[39m \u001b[33;03m    \"\"\"\u001b[39;00m\n\u001b[32m--> \u001b[39m\u001b[32m115\u001b[39m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mrequest\u001b[49m\u001b[43m(\u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mpost\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdata\u001b[49m\u001b[43m=\u001b[49m\u001b[43mdata\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mjson\u001b[49m\u001b[43m=\u001b[49m\u001b[43mjson\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
      "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\80569\\miniconda3\\envs\\vnpy\\Lib\\site-packages\\requests\\api.py:59\u001b[39m, in \u001b[36mrequest\u001b[39m\u001b[34m(method, url, **kwargs)\u001b[39m\n\u001b[32m     55\u001b[39m \u001b[38;5;66;03m# By using the 'with' statement we are sure the session is closed, thus we\u001b[39;00m\n\u001b[32m     56\u001b[39m \u001b[38;5;66;03m# avoid leaving sockets open which can trigger a ResourceWarning in some\u001b[39;00m\n\u001b[32m     57\u001b[39m \u001b[38;5;66;03m# cases, and look like a memory leak in others.\u001b[39;00m\n\u001b[32m     58\u001b[39m \u001b[38;5;28;01mwith\u001b[39;00m sessions.Session() \u001b[38;5;28;01mas\u001b[39;00m session:\n\u001b[32m---> \u001b[39m\u001b[32m59\u001b[39m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43msession\u001b[49m\u001b[43m.\u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m=\u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43murl\u001b[49m\u001b[43m=\u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
      "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\80569\\miniconda3\\envs\\vnpy\\Lib\\site-packages\\requests\\sessions.py:589\u001b[39m, in \u001b[36mSession.request\u001b[39m\u001b[34m(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)\u001b[39m\n\u001b[32m    584\u001b[39m send_kwargs = {\n\u001b[32m    585\u001b[39m     \u001b[33m\"\u001b[39m\u001b[33mtimeout\u001b[39m\u001b[33m\"\u001b[39m: timeout,\n\u001b[32m    586\u001b[39m     \u001b[33m\"\u001b[39m\u001b[33mallow_redirects\u001b[39m\u001b[33m\"\u001b[39m: allow_redirects,\n\u001b[32m    587\u001b[39m }\n\u001b[32m    588\u001b[39m send_kwargs.update(settings)\n\u001b[32m--> \u001b[39m\u001b[32m589\u001b[39m resp = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43msend\u001b[49m\u001b[43m(\u001b[49m\u001b[43mprep\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43msend_kwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m    591\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m resp\n",
      "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\80569\\miniconda3\\envs\\vnpy\\Lib\\site-packages\\requests\\sessions.py:703\u001b[39m, in \u001b[36mSession.send\u001b[39m\u001b[34m(self, request, **kwargs)\u001b[39m\n\u001b[32m    700\u001b[39m start = preferred_clock()\n\u001b[32m    702\u001b[39m \u001b[38;5;66;03m# Send the request\u001b[39;00m\n\u001b[32m--> \u001b[39m\u001b[32m703\u001b[39m r = \u001b[43madapter\u001b[49m\u001b[43m.\u001b[49m\u001b[43msend\u001b[49m\u001b[43m(\u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m    705\u001b[39m \u001b[38;5;66;03m# Total elapsed time of the request (approximately)\u001b[39;00m\n\u001b[32m    706\u001b[39m elapsed = preferred_clock() - start\n",
      "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\80569\\miniconda3\\envs\\vnpy\\Lib\\site-packages\\requests\\adapters.py:667\u001b[39m, in \u001b[36mHTTPAdapter.send\u001b[39m\u001b[34m(self, request, stream, timeout, verify, cert, proxies)\u001b[39m\n\u001b[32m    664\u001b[39m     timeout = TimeoutSauce(connect=timeout, read=timeout)\n\u001b[32m    666\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m667\u001b[39m     resp = \u001b[43mconn\u001b[49m\u001b[43m.\u001b[49m\u001b[43murlopen\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m    668\u001b[39m \u001b[43m        \u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m=\u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m.\u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    669\u001b[39m \u001b[43m        \u001b[49m\u001b[43murl\u001b[49m\u001b[43m=\u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    670\u001b[39m \u001b[43m        \u001b[49m\u001b[43mbody\u001b[49m\u001b[43m=\u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m.\u001b[49m\u001b[43mbody\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    671\u001b[39m \u001b[43m        \u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m=\u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m.\u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    672\u001b[39m \u001b[43m        \u001b[49m\u001b[43mredirect\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[32m    673\u001b[39m \u001b[43m        \u001b[49m\u001b[43massert_same_host\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[32m    674\u001b[39m \u001b[43m        \u001b[49m\u001b[43mpreload_content\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[32m    675\u001b[39m \u001b[43m        \u001b[49m\u001b[43mdecode_content\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[32m    676\u001b[39m \u001b[43m        \u001b[49m\u001b[43mretries\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mmax_retries\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    677\u001b[39m \u001b[43m        \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[43m=\u001b[49m\u001b[43mtimeout\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    678\u001b[39m \u001b[43m        \u001b[49m\u001b[43mchunked\u001b[49m\u001b[43m=\u001b[49m\u001b[43mchunked\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    679\u001b[39m \u001b[43m    \u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m    681\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m (ProtocolError, \u001b[38;5;167;01mOSError\u001b[39;00m) \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[32m    682\u001b[39m     \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mConnectionError\u001b[39;00m(err, request=request)\n",
      "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\80569\\miniconda3\\envs\\vnpy\\Lib\\site-packages\\urllib3\\connectionpool.py:787\u001b[39m, in \u001b[36mHTTPConnectionPool.urlopen\u001b[39m\u001b[34m(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)\u001b[39m\n\u001b[32m    784\u001b[39m response_conn = conn \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m release_conn \u001b[38;5;28;01melse\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[32m    786\u001b[39m \u001b[38;5;66;03m# Make the request on the HTTPConnection object\u001b[39;00m\n\u001b[32m--> \u001b[39m\u001b[32m787\u001b[39m response = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_make_request\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m    788\u001b[39m \u001b[43m    \u001b[49m\u001b[43mconn\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    789\u001b[39m \u001b[43m    \u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    790\u001b[39m \u001b[43m    \u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    791\u001b[39m \u001b[43m    \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[43m=\u001b[49m\u001b[43mtimeout_obj\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    792\u001b[39m \u001b[43m    \u001b[49m\u001b[43mbody\u001b[49m\u001b[43m=\u001b[49m\u001b[43mbody\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    793\u001b[39m \u001b[43m    \u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m=\u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    794\u001b[39m \u001b[43m    \u001b[49m\u001b[43mchunked\u001b[49m\u001b[43m=\u001b[49m\u001b[43mchunked\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    795\u001b[39m \u001b[43m    \u001b[49m\u001b[43mretries\u001b[49m\u001b[43m=\u001b[49m\u001b[43mretries\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    796\u001b[39m \u001b[43m    \u001b[49m\u001b[43mresponse_conn\u001b[49m\u001b[43m=\u001b[49m\u001b[43mresponse_conn\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    797\u001b[39m \u001b[43m    \u001b[49m\u001b[43mpreload_content\u001b[49m\u001b[43m=\u001b[49m\u001b[43mpreload_content\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    798\u001b[39m \u001b[43m    \u001b[49m\u001b[43mdecode_content\u001b[49m\u001b[43m=\u001b[49m\u001b[43mdecode_content\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    799\u001b[39m \u001b[43m    \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mresponse_kw\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    800\u001b[39m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m    802\u001b[39m \u001b[38;5;66;03m# Everything went great!\u001b[39;00m\n\u001b[32m    803\u001b[39m clean_exit = \u001b[38;5;28;01mTrue\u001b[39;00m\n",
      "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\80569\\miniconda3\\envs\\vnpy\\Lib\\site-packages\\urllib3\\connectionpool.py:493\u001b[39m, in \u001b[36mHTTPConnectionPool._make_request\u001b[39m\u001b[34m(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)\u001b[39m\n\u001b[32m    490\u001b[39m \u001b[38;5;66;03m# conn.request() calls http.client.*.request, not the method in\u001b[39;00m\n\u001b[32m    491\u001b[39m \u001b[38;5;66;03m# urllib3.request. It also calls makefile (recv) on the socket.\u001b[39;00m\n\u001b[32m    492\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m493\u001b[39m     \u001b[43mconn\u001b[49m\u001b[43m.\u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m    494\u001b[39m \u001b[43m        \u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    495\u001b[39m \u001b[43m        \u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    496\u001b[39m \u001b[43m        \u001b[49m\u001b[43mbody\u001b[49m\u001b[43m=\u001b[49m\u001b[43mbody\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    497\u001b[39m \u001b[43m        \u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m=\u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    498\u001b[39m \u001b[43m        \u001b[49m\u001b[43mchunked\u001b[49m\u001b[43m=\u001b[49m\u001b[43mchunked\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    499\u001b[39m \u001b[43m        \u001b[49m\u001b[43mpreload_content\u001b[49m\u001b[43m=\u001b[49m\u001b[43mpreload_content\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    500\u001b[39m \u001b[43m        \u001b[49m\u001b[43mdecode_content\u001b[49m\u001b[43m=\u001b[49m\u001b[43mdecode_content\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    501\u001b[39m \u001b[43m        \u001b[49m\u001b[43menforce_content_length\u001b[49m\u001b[43m=\u001b[49m\u001b[43menforce_content_length\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    502\u001b[39m \u001b[43m    \u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m    504\u001b[39m \u001b[38;5;66;03m# We are swallowing BrokenPipeError (errno.EPIPE) since the server is\u001b[39;00m\n\u001b[32m    505\u001b[39m \u001b[38;5;66;03m# legitimately able to close the connection after sending a valid response.\u001b[39;00m\n\u001b[32m    506\u001b[39m \u001b[38;5;66;03m# With this behaviour, the received response is still readable.\u001b[39;00m\n\u001b[32m    507\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mBrokenPipeError\u001b[39;00m:\n",
      "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\80569\\miniconda3\\envs\\vnpy\\Lib\\site-packages\\urllib3\\connection.py:494\u001b[39m, in \u001b[36mHTTPConnection.request\u001b[39m\u001b[34m(self, method, url, body, headers, chunked, preload_content, decode_content, enforce_content_length)\u001b[39m\n\u001b[32m    492\u001b[39m \u001b[38;5;28;01mfor\u001b[39;00m header, value \u001b[38;5;129;01min\u001b[39;00m headers.items():\n\u001b[32m    493\u001b[39m     \u001b[38;5;28mself\u001b[39m.putheader(header, value)\n\u001b[32m--> \u001b[39m\u001b[32m494\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mendheaders\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m    496\u001b[39m \u001b[38;5;66;03m# If we're given a body we start sending that in chunks.\u001b[39;00m\n\u001b[32m    497\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m chunks \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n",
      "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\80569\\miniconda3\\envs\\vnpy\\Lib\\http\\client.py:1333\u001b[39m, in \u001b[36mHTTPConnection.endheaders\u001b[39m\u001b[34m(self, message_body, encode_chunked)\u001b[39m\n\u001b[32m   1331\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m   1332\u001b[39m     \u001b[38;5;28;01mraise\u001b[39;00m CannotSendHeader()\n\u001b[32m-> \u001b[39m\u001b[32m1333\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_send_output\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmessage_body\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mencode_chunked\u001b[49m\u001b[43m=\u001b[49m\u001b[43mencode_chunked\u001b[49m\u001b[43m)\u001b[49m\n",
      "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\80569\\miniconda3\\envs\\vnpy\\Lib\\http\\client.py:1093\u001b[39m, in \u001b[36mHTTPConnection._send_output\u001b[39m\u001b[34m(self, message_body, encode_chunked)\u001b[39m\n\u001b[32m   1091\u001b[39m msg = \u001b[33mb\u001b[39m\u001b[33m\"\u001b[39m\u001b[38;5;130;01m\\r\u001b[39;00m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[33m\"\u001b[39m.join(\u001b[38;5;28mself\u001b[39m._buffer)\n\u001b[32m   1092\u001b[39m \u001b[38;5;28;01mdel\u001b[39;00m \u001b[38;5;28mself\u001b[39m._buffer[:]\n\u001b[32m-> \u001b[39m\u001b[32m1093\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43msend\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmsg\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m   1095\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m message_body \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[32m   1096\u001b[39m \n\u001b[32m   1097\u001b[39m     \u001b[38;5;66;03m# create a consistent interface to message_body\u001b[39;00m\n\u001b[32m   1098\u001b[39m     \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mhasattr\u001b[39m(message_body, \u001b[33m'\u001b[39m\u001b[33mread\u001b[39m\u001b[33m'\u001b[39m):\n\u001b[32m   1099\u001b[39m         \u001b[38;5;66;03m# Let file-like take precedence over byte-like.  This\u001b[39;00m\n\u001b[32m   1100\u001b[39m         \u001b[38;5;66;03m# is needed to allow the current position of mmap'ed\u001b[39;00m\n\u001b[32m   1101\u001b[39m         \u001b[38;5;66;03m# files to be taken into account.\u001b[39;00m\n",
      "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\80569\\miniconda3\\envs\\vnpy\\Lib\\http\\client.py:1037\u001b[39m, in \u001b[36mHTTPConnection.send\u001b[39m\u001b[34m(self, data)\u001b[39m\n\u001b[32m   1035\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m.sock \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[32m   1036\u001b[39m     \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m.auto_open:\n\u001b[32m-> \u001b[39m\u001b[32m1037\u001b[39m         \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mconnect\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m   1038\u001b[39m     \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m   1039\u001b[39m         \u001b[38;5;28;01mraise\u001b[39;00m NotConnected()\n",
      "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\80569\\miniconda3\\envs\\vnpy\\Lib\\site-packages\\urllib3\\connection.py:325\u001b[39m, in \u001b[36mHTTPConnection.connect\u001b[39m\u001b[34m(self)\u001b[39m\n\u001b[32m    324\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34mconnect\u001b[39m(\u001b[38;5;28mself\u001b[39m) -> \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m325\u001b[39m     \u001b[38;5;28mself\u001b[39m.sock = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_new_conn\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m    326\u001b[39m     \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m._tunnel_host:\n\u001b[32m    327\u001b[39m         \u001b[38;5;66;03m# If we're tunneling it means we're connected to our proxy.\u001b[39;00m\n\u001b[32m    328\u001b[39m         \u001b[38;5;28mself\u001b[39m._has_connected_to_proxy = \u001b[38;5;28;01mTrue\u001b[39;00m\n",
      "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\80569\\miniconda3\\envs\\vnpy\\Lib\\site-packages\\urllib3\\connection.py:198\u001b[39m, in \u001b[36mHTTPConnection._new_conn\u001b[39m\u001b[34m(self)\u001b[39m\n\u001b[32m    193\u001b[39m \u001b[38;5;250m\u001b[39m\u001b[33;03m\"\"\"Establish a socket connection and set nodelay settings on it.\u001b[39;00m\n\u001b[32m    194\u001b[39m \n\u001b[32m    195\u001b[39m \u001b[33;03m:return: New socket connection.\u001b[39;00m\n\u001b[32m    196\u001b[39m \u001b[33;03m\"\"\"\u001b[39;00m\n\u001b[32m    197\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m198\u001b[39m     sock = \u001b[43mconnection\u001b[49m\u001b[43m.\u001b[49m\u001b[43mcreate_connection\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m    199\u001b[39m \u001b[43m        \u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_dns_host\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mport\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    200\u001b[39m \u001b[43m        \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mtimeout\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    201\u001b[39m \u001b[43m        \u001b[49m\u001b[43msource_address\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43msource_address\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    202\u001b[39m \u001b[43m        \u001b[49m\u001b[43msocket_options\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43msocket_options\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m    203\u001b[39m \u001b[43m    \u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m    204\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m socket.gaierror \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[32m    205\u001b[39m     \u001b[38;5;28;01mraise\u001b[39;00m NameResolutionError(\u001b[38;5;28mself\u001b[39m.host, \u001b[38;5;28mself\u001b[39m, e) \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01me\u001b[39;00m\n",
      "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\80569\\miniconda3\\envs\\vnpy\\Lib\\site-packages\\urllib3\\util\\connection.py:81\u001b[39m, in \u001b[36mcreate_connection\u001b[39m\u001b[34m(address, timeout, source_address, socket_options)\u001b[39m\n\u001b[32m     79\u001b[39m         err = _\n\u001b[32m     80\u001b[39m         \u001b[38;5;28;01mif\u001b[39;00m sock \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[32m---> \u001b[39m\u001b[32m81\u001b[39m             \u001b[43msock\u001b[49m\u001b[43m.\u001b[49m\u001b[43mclose\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m     83\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m err \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[32m     84\u001b[39m     \u001b[38;5;28;01mtry\u001b[39;00m:\n",
      "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\80569\\miniconda3\\envs\\vnpy\\Lib\\socket.py:501\u001b[39m, in \u001b[36msocket.close\u001b[39m\u001b[34m(self)\u001b[39m\n\u001b[32m    497\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34m_real_close\u001b[39m(\u001b[38;5;28mself\u001b[39m, _ss=_socket.socket):\n\u001b[32m    498\u001b[39m     \u001b[38;5;66;03m# This function should not reference any globals. See issue #808164.\u001b[39;00m\n\u001b[32m    499\u001b[39m     _ss.close(\u001b[38;5;28mself\u001b[39m)\n\u001b[32m--> \u001b[39m\u001b[32m501\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34mclose\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[32m    502\u001b[39m     \u001b[38;5;66;03m# This function should not reference any globals. See issue #808164.\u001b[39;00m\n\u001b[32m    503\u001b[39m     \u001b[38;5;28mself\u001b[39m._closed = \u001b[38;5;28;01mTrue\u001b[39;00m\n\u001b[32m    504\u001b[39m     \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m._io_refs <= \u001b[32m0\u001b[39m:\n",
      "\u001b[31mKeyboardInterrupt\u001b[39m: "
     ]
    }
   ],
   "source": [
    "# 遍历列表执行下载\n",
    "for vt_symbol in vt_symbols:\n",
    "    # 拆分合约代码和交易所\n",
    "    symbol, exchange = extract_vt_symbol(vt_symbol)\n",
    "\n",
    "    # 创建历史数据请求对象\n",
    "    req: HistoryRequest = HistoryRequest(\n",
    "        symbol=symbol,\n",
    "        exchange=exchange,\n",
    "        start=start,\n",
    "        end=end,\n",
    "        interval=Interval.DAILY        # 这里下载最常用的1分钟K线\n",
    "    )\n",
    "\n",
    "    # 从数据服务下载数据\n",
    "    bars: list[BarData] = datafeed.query_bar_history(req)\n",
    "\n",
    "    # 如果下载成功则保存\n",
    "    if bars:\n",
    "        database.save_bar_data(bars)\n",
    "        print(f\"下载数据成功：{vt_symbol}，总数据量：{len(bars)}\")\n",
    "    # 否则失败则打印信息\n",
    "    else:\n",
    "        print(f\"下载数据失败：{vt_symbol}\")\n",
    "    \n",
    "    print(\"全部下载完成\")\n",
    "    updateEndTimeSql = \"\"\" update dbbaroverview set end = now() where 1=1\"\"\"\n",
    "    #更新时间为最新更新时间\n",
    "\n",
    "    cursor.execute(updateEndTimeSql)\n",
    "    print(\"更新数据库时间成功\")\n",
    "    conn.commit()\n",
    "    conn.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "vnpy",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
